﻿using System;

namespace ITSP_Instance_Generator
{
    class Position
    {
        public double X { get; private set; }
        public double Y { get; private set; }

        public Position(double x, double y)
        {
            X = x;
            Y = y;
        }

        public double DistanceTo(Position otherPosition)
        {
            return DistanceToDouble(otherPosition);
        }
        private double DistanceToDouble(Position otherPosition)
        {
            double distanceX = otherPosition.X - X;
            double distanceY = otherPosition.Y - Y;
            return Math.Sqrt(distanceX * distanceX + distanceY * distanceY);
        }

        public Position Clone()
        {
            return new Position(X, Y);
        }
    }
}
